import React from "react"
// import { useParams, useMatch } from "react-router-dom"
// // params 传参

// import { useSearchParams, useLocation } from "react-router-dom"
// // search 传参

import { useLocation } from "react-router-dom"
// state 传参
export default function Message() {
  // const a = useMatch("/home/message/:id")
  // console.log(a)

  // const { id } = useParams()
  // <div>home-----message----id:{id}</div>
  // // params 传参

  // const [search, setSearch] = useSearchParams()
  // // console.log(search, setSearch)
  // const id = search.get("id")
  // // setSearch('id=10000')
  // const a = useLocation()
  // // console.log(a)
  // <div onClick={() => setSearch("id=10000")}>home-----message----id:{id}</div>
  // // search 传参

  const {state:{id}} = useLocation()

  // return <div>home-----message</div>
  return    <div>home-----message----id:{id}</div>

}
